<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>XLLoop - A Python Function Server</title>
        <link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon"/>
        <link rel="stylesheet" href="style.css" type="text/css" />
        <meta name="description" content="Excel Addin Framework for Java"/>
        <meta name="keywords" content="python, excel, addin, xll, xloper"/>
        <meta http-equiv="pragma" content="no-cache"/>    
    </head>

    <body>

    <div id="heading">
        <div class="title"><a href="index.html"><img border="0" src="logo.gif"/></a>XLLoop</div>
        <div class="subtitle">A Python Function Server</div>
    </div>
    
    <div class="content">
        <div class="section">
            <div class="section-title">About</div>
            <div class="section-content">
            Included in the download is a Python implementation of the XLLoop server process. 
        </div>

        <div class="section">
            <div class="section-title">Usage</div>
            <div class="section-content">
            The Python server implementation consists of a single file: xlloop.py. The code listing 
            for an example server is as follows (also included in the download):
<pre>
from xlloop import *
import string, random

class TestHandler:
    def invoke(self, name, args):
        if name == 'ArgsTest':
            return args
        elif name == 'RandTest':
            len = int(random.random() * 50 + 2)
            a = []
            for i in xrange(len):
                v = int(random.random() * 4)
                if v == 0:
                    a.append("".join(random.sample(string.letters+string.digits, 50)))
                elif v == 1:
                    a.append(int(random.random() * 1000))
                elif v == 2:
                    if int(random.random() * 2) == 1:
                        a.append(True)
                    else:
                        a.append(False)
                else:
                    a.append(random.random() * 1000)
            return a
        else:
            return [random.random() * 1000, 'Hello World!', 23.3, 11111]
        
h = TestHandler()
xs = XLLoopServer(h)
xs.start()
</pre>
This creates a new server (a socket listening on port 5454). 
            <div class="section-content">
            </div>
        </div>

    </div>

    <div id="footer">
		<div class="section-title"/>
        <a href="http://www.opensource.org/docs/definition.php"><img border="0" alt="Open Source" src="http://opensource.org/trademarks/open_source_button.png" style="width:88px;height:31px" /></a>
        <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=222420&amp;type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
    </div>
</body>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/xlloop/" : "http://apps.sourceforge.net/piwik/xlloop/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 1;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
</script>
<object><noscript><p><img src="http://apps.sourceforge.net/piwik/xlloop/piwik.php?idsite=1" alt="piwik"/></p></noscript></object>
<!-- End Piwik Tag -->
</html>